export function countAllNodes<T extends { children: any[] }>(nodes: T[]): number {
  let count = 0
  for (const child of nodes) {
    count += 1
    if (child.children)
      count += countAllNodes(child.children)
  }
  return count
}
